﻿using System;
using System.Globalization;
using NUnit.Framework;
using RadaCode.SwissKnife;

namespace SwissKnife.Tests
{
    [TestFixture]
    public class TimeSpanToReadableStringTests
    {
        [Test]
        public void TestInvariantCulture()
        {
            const string correctString = "5 d. 6 h. 12 min.";

            var readableString = TimeSpanToReadableString.Convert(new TimeSpan(5, 6, 12, 0));
            Assert.AreEqual(readableString, correctString);
        }

        [Test]
        public void TestRusHoursAndMinutes()
        {
            const string correctString = "3 ч. 28 мин.";

            var readableString = TimeSpanToReadableString.Convert(new TimeSpan(3, 28, 0), new CultureInfo("ru"));
            Assert.AreEqual(readableString, correctString);
        }
    }
}
